const mongoose = require('mongoose');
const bcrypt = require('bcryptjs');

const Schema = mongoose.Schema,
    ObjectId = Schema.ObjectId;

/**
 * 客户表示一个企业级用户
 * @type {mongoose.Schema}
 */
let schema = new Schema({
    account         : {type : String, required: true, unique : true},       //登录名
    password        : {type : String, required: true},
    name            : String,
    wl_req_ip       : String, //白名单IP
    create_time : {type : Date, default : Date.now},
    status : {type : Number, default : 1},
    report_url : String, //'' = get, url = push
    mo_url : String, //'' = get, url = push
    push_type : String, //iqiyi or cainiao
    push_limit : {type : Number, default : 50}
});

let model = mongoose.model('customer', schema);

module.exports = model;
